<template>
	<view class="page">
		<view class="info-list">
			<view class="info-key">
				头像
			</view>
			<view class="info-value">
				<image src="../../static/icon/member.png" class="face"></image>
			</view>
		</view>
		
		<view class="line-wrapper">
			<view class="line">
			</view>
		</view>
		
		<view class="line-wrapper">
			<view class="line">
			</view>
		</view>
		
		<view class="info-list">
			<view class="info-key">
				姓名
			</view>
			<view class="info-value">
				{{loginUser.userName}}
			</view>
		</view>
		
		<view class="line-wrapper">
			<view class="line">
			</view>
		</view>
		
		<view class="line-wrapper">
			<view class="line">
			</view>
		</view>
		
		<view class="info-list">
			<view class="info-key">
				出生日期
			</view>
			<view class="info-value">
				xxxx-xx-xx
			</view>
		</view>
		
		<view class="line-wrapper">
			<view class="line">
			</view>
		</view>
		
		<view class="info-list">
			<view class="info-key">
				性别
			</view>
			<view class="info-value">
				{{loginUser.sex?'男':'女'}}
			</view>
		</view>
		
		<view class="line-wrapper">
			<view class="line">
			</view>
		</view>
		
		<view class="line-wrapper">
			<view class="line">
			</view>
		</view>
		
		<view class="info-list">
			<view class="info-key">
				手机号码
			</view>
			<view class="info-value">
				134****7371
			</view>
		</view>
		
		<view class="line-wrapper">
			<view class="line">
			</view>
		</view>
		
		<view class="line-wrapper">
			<view class="line">
			</view>
		</view>
		
		<view class="info-list">
			<view class="info-key">
				街道*
			</view>
			<view class="info-value">
				斗门白蕉
			</view>
		</view>
		
		<view class="line-wrapper">
			<view class="line">
			</view>
		</view>
		
		<view class="line-wrapper">
			<view class="line">
			</view>
		</view>
		
		<view class="info-list" style="border-radius: 0 0 20rpx 20rpx;">
			<view class="info-key">
				家庭住址*
			</view>
			<view class="info-value">
				南方IT学院
			</view>
		</view>
		
		
		<view class="foot-wrapper">
			<view class="btn">
				保存
			</view>
			<view class="btn" @click="clearStorage">
				清理缓存
			</view>
			<view class="btn" @click="logout">
				退出登录
			</view>
		</view>
		
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				loginUser:{}
			}
		},
		onShow() {
			let loginUser = this.$getStorageSync("loginUser") ;
			if(loginUser==null) {
				uni.switchTab({
					url:'login'
				})
			}
			this.loginUser = loginUser ;
		},
		methods: {
			clearStorage() {
				uni.clearStorageSync() ;
				uni.showToast({
					title:'清理缓存成功',
					mask:true,
					duration:2000
				});
				uni.switchTab({
					url:'me'
				});
			},
			async logout() {
				
				uni.removeStorageSync("token") ;
				uni.switchTab({
					url:'me'
				})
			}
		}
	}
</script>

<style>
	@import url("meinfo.css");
</style>
